package com.lzh.tiktok.user.vo;

import com.lzh.common.constant.TiktokConstant;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @author lizhihang
 * @create 2023-01-17 11:49
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class UserResponseVo {


    /* 状态码，0是成功 其他值是失败*/

    private Integer status_code;

    /*  状态描述*/

    private String status_msg;
    /**
     * 用户id
     */
    private Integer user_id;
    /**
     * 用户鉴权token
     */
    private String token;


    public static UserResponseVo success(Integer userId, String token) {
        UserResponseVo UserResponseVo = new UserResponseVo(TiktokConstant.responseStatus.SUCCESS_STATUS.getCode(), "成功", userId, token);
        return UserResponseVo;
    }

    public static UserResponseVo success(Integer userId, String token, String status_msg) {
        UserResponseVo UserResponseVo = new UserResponseVo(TiktokConstant.responseStatus.SUCCESS_STATUS.getCode(), status_msg, userId, token);
        return UserResponseVo;
    }

    public static UserResponseVo fail() {
        UserResponseVo UserResponseVo = new UserResponseVo(TiktokConstant.responseStatus.FAIL_STATUS.getCode(), "失败", null, null);
        return UserResponseVo;
    }


    public static UserResponseVo fail(String status_msg) {
        UserResponseVo UserResponseVo = new UserResponseVo(TiktokConstant.responseStatus.FAIL_STATUS.getCode(), status_msg, null, null);
        return UserResponseVo;
    }
}
